import request from '@/utils/request'

export function getOrders() {
  return request({
    url: 'combos',
    method: 'get'
  })
}

export function addOrder(data) {
  return request({
    url: 'combos',
    method: 'post',
    data
  })
}

export function updateOrder(id,data) {
  return request({
    url: `combos`,
    method: 'put',
    data
  })
}

export function deleteOrder(id) {
  return request({
    url: `combos/${id}`,
    method: 'delete'
  })
}


export function getConsumers() {
  return request({
    url: 'consumers',
    method: 'get'
  })
}

export function getConsumersCondition(data) {
  return request({
    url: 'consumers/conditions',
    method: 'post',
    data
  })
}

export function addConsumer(data) {
  return request({
    url: 'consumers',
    method: 'post',
    data
  })
}

export function updateConsumer(id, data) {
  return request({
    url: `consumers`,
    method: 'put',
    data
  })
}

export function deleteConsumer(id) {
  return request({
    url: `consumers/${id}`,
    method: 'delete'
  })
}



export function getGradesSys() {
  return request({
    url: `baseconfig/grade`,
    method: 'get'
  })
}

export function addGradeSys(data) {
  return request({
    url: `baseconfig`,
    method: 'post',
    data
  })
}

export function updateGradeSys(id, data) {
  return request({
    url: `baseconfig`,
    method: 'put',
    data
  })
}

export function deleteGradeSys(id) {
  return request({
    url: `baseconfig/${id}`,
    method: 'delete'
  })
}


///学段
export function getStages(type) {
  return request({
    // url: '/vue-admin-template/stages',
    url: `baseconfig/stage`,
    method: 'get'
  })
}

export function addStage(data) {
  return request({
    url:  'baseconfig',
    method: 'post',
    data
  })
}

export function updateStage(id, data) {
  return request({
    url: `baseconfig`,
    method: 'put',
    data
  })
}

export function deleteStage(id) {
  return request({
    url:  `baseconfig/${id}`,
    method: 'delete'
  })
}



